﻿/*
 * Created by SharpDevelop.
 * User: Jack Brinegar
 * Date: 1/31/2013
 * Time: 9:55 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace AdminDesktop.Controls
{
	/// <summary>
	/// Description of ucOptions_General.
	/// </summary>
	public partial class ucOptions_General : UserControl
	{
		public ucOptions_General()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
			
			LoadOptionData();
				
		}
		
		private void LoadOptionData()
		{
			this.chkUseTitleCase.Checked = DataEngine.APP_CONFIG.UseTitleCase;
			this.txtDataDirectory.Text=DataEngine.APP_CONFIG.DataDirectory;
			this.txtBackupDataDirectory.Text=DataEngine.APP_CONFIG.BackupDataDirectory;
			this.txtTempReportDirectory.Text=DataEngine.APP_CONFIG.TemporaryDirectory;
		}
		
		void ChkUseTitleCaseCheckedChanged(object sender, EventArgs e)
		{
			DataEngine.APP_CONFIG.UseTitleCase=bool.Parse(this.chkUseTitleCase.Checked.ToString());
			//DataEngine.SaveAppConfig();
		}
		
		void TxtDataDirectoryTextChanged(object sender, EventArgs e)
		{
			DataEngine.APP_CONFIG.DataDirectory=this.txtDataDirectory.Text;
			//DataEngine.SaveAppConfig();
		}
		
		void TxtBackupDataDirectoryTextChanged(object sender, EventArgs e)
		{
			DataEngine.APP_CONFIG.BackupDataDirectory=this.txtBackupDataDirectory.Text;
			//DataEngine.SaveAppConfig();
		}
		
		void TxtTempReportDirectoryTextChanged(object sender, EventArgs e)
		{
			DataEngine.APP_CONFIG.TemporaryDirectory=this.txtTempReportDirectory.Text;
		}
	}
}
